package com.subfg.payment.constant;

import com.subfg.common.entity.excpetion.BusinessExceptionModel;
import com.subfg.common.util.common.StringUtil;

public enum DifferentSystemEnum {
    APPLET("Applet"),
    WEB("Web"),
    APP("App"),
    QRCODE("Common")
    ;
    private String values;

    DifferentSystemEnum(String values) {
        this.values = values;
    }

    public String getValues() {
        return values;
    }

    // 是否支持该平台支付
    public static DifferentSystemEnum matchingSystem(String payType) throws BusinessExceptionModel {
        if (!StringUtil.isEmpty(payType)) {
            for (DifferentSystemEnum payMethod : DifferentSystemEnum.values()) {
                if (payMethod.getValues().equals(payType)) {
                    return payMethod;
                }
            }
        }
        throw new BusinessExceptionModel();
    }
}
